<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
	<h3>Questionarios disponíveis</h3>
	
	<table>
		<tr>
			<th>Nome</th>
			<th>Data início</th>
			<th>Data fim</th>
			<th>Liberado</th>
			<th>Editar</th>
			<th>Excluir</th>
		</tr>
		<c:forEach var="questionario" items="${questionarios}">
			<tr>	
				<td><a href="<spring:url value="/questionarios/${questionario.id}" />">${questionario.descricao}</a></td>
				<td><fmt:formatDate pattern="dd/MM/yyyy" value="${questionario.dataInicio}" /></td>
				<td><fmt:formatDate pattern="dd/MM/yyyy" value="${questionario.dataFim}" /></td>
				<td><a href="<spring:url value="/questionarios/${questionario.id}/editar" />">Editar</a></td>
				<td><a href="<spring:url value="/questionarios/${questionario.id}/excluir" />">Excluir</a></td>
			</tr>
		</c:forEach>
	</table>
	<a href="<spring:url value="/questionarios/novo" />">Novo questionário</a>

</body>
</html>